﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using SAM.Framework.Repository.Repositories.Pager;

namespace SAM.Framework.RepositoryDapper.NET40
{
    public partial class DapperRepositoryBase<TEntity> : IPager<TEntity>
    {
        /// <summary>
        /// 分页的基础sql
        /// {0}: pageSize,
        /// {1}: 数据集
        /// {2}: pageSize * (pageIndex - 1)
        /// {3}: 排序（必须默认一个）
        /// {4}: 筛选条件
        /// </summary>
        protected string pageSql = @"select top {0} * from ({1}) a 
                    where Id > (select isnull( max(id), 0 ) from ( 
                    select top {2} id from ({1}) a order by {3} ) 
                    tmp ) and {4} order by {3}";

        public virtual PageResult<TEntity> GetPage(PageOption<TEntity> option)
        {
            throw new NotImplementedException();
        }
    }
}
